import 'package:flutter/material.dart';

class LoveChat extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return new _LoveChatState();
  }
}

class _LoveChatState extends State<LoveChat> with TickerProviderStateMixin{
  final List<Tab> _messageCategory = <Tab>[
    new Tab(text: '系统通知',),
    new Tab(text: '私信',),
  ];

  TabController _messageCategoryController;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _messageCategoryController = new TabController(length: _messageCategory.length, vsync: this);
  }

  @override
  void dispose() {
    // TODO: implement dispose
    _messageCategoryController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new Scaffold(
      backgroundColor: Colors.white,
      appBar: new AppBar(
        title: new Text('Message'),
        bottom: new TabBar(tabs: _messageCategory,controller: _messageCategoryController,),
      ),
      body: new TabBarView(children: _messageCategory,controller: _messageCategoryController,),
    );
  }
}
